<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="css/mui.css" rel="stylesheet" />
		<script src="js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="//g.alicdn.com/dingding/open-develop/1.6.9/dingtalk.js"></script>
		<script src="js/common.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<style type="text/css">
		.body {
			margin-top: 45px;
			background-color: #FFFFFF;
		}

		.mui-btn {
			border-radius: 6px;
		}

		.title {
			padding: 20px;
			padding-bottom: 0px;
		}

		.information {
			padding: 15px;
			display: flex;
		}

		.val {
			text-align: left;
		}

		.name {
			font-weight: 700;
		}

		.list {
			width: 30%;
			line-height: 30px;

		}

		.list1 {
			width: 70%;
			line-height: 30px;

		}

		.val {
			word-wrap: break-word;
		}

		.fix {
			display: flex;
		}

		button {
			width: 100% !important;

		}

		.btn {
			padding: 20px;

		}

		span {
			font-weight: 700;
		}
	</style>
	<body>
		<script src="js/mui.js"></script>
		<script type="text/javascript">
			mui.init()
			$(function() {


				var id;
				var badge;
				var datas;
				dd.ready(function() {
					dd.runtime.permission.requestAuthCode({
						corpId: 'dingdd68e5ace8321d7a35c2f4657eb6378f', // 企业id
						onSuccess: function(info) {
							// 通过该免登授权码可以获取用户身份
							var json = new Object();
							json.authCode = info.code;
							$.ajax({
								url: route + 'login',
								//将获取到的code传到后台
								data: JSON.stringify(json),
								headers: {
									"Content-Type": "application/json;charset=UTF-8"
								},
								dataType: 'json', //服务器返回json格式数据
								type: 'post', //HTTP请求类型
								success: function(data) {
									id = data.userId;
									badge = data.jobNumber;
									//将用户信息渲染到页面
									$("#name1").text(data.name);
									$("#name2").text(data.position);
									$("#name3").text(data.jobNumber);
									$("#name4").text(data.mobile);
								},
								error: function(XMLHttpRequest, textStatus, errorThrown) {
									//alert(textStatus); 
								}
							});
						},
						onFail: function(err) {
							//alert(JSON.stringify(data));
						},

					});

				});
				$(".b").click(function() {
					//获取页面里各个单选框的值
					var isFever = $('input:radio[name="isFever"]:checked').val();
					var isResumption = $('input:radio[name="isResumption"]:checked').val();
					var isDiscomfort = $('input:radio[name="isDiscomfort"]:checked').val();
					var isOnchuzhou = $('input:radio[name="isOnchuzhou"]:checked').val();
					var isField = $('input:radio[name="isField"]:checked').val();
					var isGoback = $('input:radio[name="isGoback"]:checked').val();
					var isLive = $('input:radio[name="isLive"]:checked').val();
					var isTravel = $('input:radio[name="isTravel"]:checked').val();
					var isContact = $('input:radio[name="isContact"]:checked').val();
					var isParty = $('input:radio[name="isParty"]:checked').val();
					var radio21 = $('input:radio[name="radio21"]:checked').val();
					var radio20 = $('input:radio[name="radio20"]:checked').val();
					//打包成JSON
					var json = new Object();
					json.userId = id;
					json.isFever = isFever;
					json.isResumption = isResumption;
					json.isDiscomfort = isDiscomfort;
					json.isDiscomfort = isDiscomfort;
					json.isOnchuzhou = isOnchuzhou;
					json.isField = isField;
					json.isGoback = isGoback;
					json.isLive = isLive;
					json.isTravel = isTravel;
					json.isContact = isContact;
					json.isParty = isParty;
					json.badge = badge;

					//判断每一道题是否填写
					if (isFever == undefined || isResumption == undefined || isDiscomfort == undefined ||
						isOnchuzhou == undefined || isField == undefined || isGoback == undefined || isLive == undefined || isTravel ==
						undefined || isContact == undefined || isParty == undefined || radio21 == undefined || radio20 == undefined) {
						alert("请检查每道题是否填写！");
						return false;

					} else {
						$.ajax({
							url: route + 'investigation/selfTesting',
							//将打包好的json传到后台
							data: JSON.stringify(json),
							headers: {
								"Content-Type": "application/json;charset=UTF-8"
							},
							dataType: 'json', //服务器返回json格式数据
							type: 'post', //HTTP请求类型
							success: function(data) {
								//code等于0则提示提交成功
								if (data.code == 0) {
									alert("提交成功！");
									mui.openWindow({
										//返回主页
										url: "./index.html"
									})
								} else {
									alert("提交失败，请联系管理员！");
								}



							},
							error: function(XMLHttpRequest, textStatus, errorThrown) {

							}
						});
					}

				})

			})
		</script>
		<!-- mui顶部导航栏 -->
		<header class="mui-bar mui-bar-nav mui-bar-nav-bg">
			<a id="icon-menu" class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<a class="mui-action-back mui-icon mui-icon-home mui-pull-right mui-a-color"></a>
			<h1 class="mui-title">新冠肺炎防疫调查</h1>
		</header>
		<div class="body">
			<!-- 用户信息 -->
			<div class="information">
				<div class="list">
					<div class="name ">
						姓名:
					</div>
					<div class="name ">
						岗位名称:
					</div>
					<div class="name ">
						岗位编号:
					</div>
					<div class="name ">
						手机号码:
					</div>

				</div>
				<div class="list1">
					<div id="name1" class="val name1">

					</div>
					<div id="name2" class="val name2">

					</div>
					<div id="name3" class="val name3">

					</div>
					<div id="name4" class="val name4">

					</div>


				</div>
			</div>


			<!-- 题目 -->
			<div class="title">
				<span>1.当前体温是否大于37.2°？</span>
				<div class="fix">
					<div class="mui-input-row mui-radio mui-left">
						<label>是</label>
						<input type="radio" name="isFever" value="1" />
					</div>
					<div class="mui-input-row mui-radio mui-left">
						<label>否</label>
						<input type="radio" name="isFever" value="0" />
					</div>
				</div>


			</div>
			<div class="title">
				<span>2.当前是否复工？</span>
				<div class="fix">
					<div class="mui-input-row mui-radio mui-left">
						<label>是</label>
						<input name="isResumption" type="radio" class="isResumption" value="1">

					</div>
					<div class="mui-input-row mui-radio mui-left">
						<label>否</label>
						<input name="isResumption" type="radio" class="isResumption" value="0">

					</div>
				</div>


			</div>
			<div class="title">
				<span>3.是否有乏力、干咳、呕吐、感冒等身体不适症状？</span>
				<div class="fix">
					<div class="mui-input-row mui-radio mui-left">
						<label>是</label>
						<input name="isDiscomfort" type="radio" class="isDiscomfort" value="1">

					</div>
					<div class="mui-input-row mui-radio mui-left">
						<label>否</label>
						<input name="isDiscomfort" type="radio" class="isDiscomfort" value="0">

					</div>
				</div>


			</div>
			<div class="title">
				<span>4.当前是否在滁州？</span>
				<div class="fix">
					<div class="mui-input-row mui-radio mui-left">
						<label>是</label>
						<input name="isOnchuzhou" type="radio" class="isOnchuzhou " value="1">

					</div>
					<div class="mui-input-row mui-radio mui-left">
						<label>否</label>
						<input name="isOnchuzhou" type="radio" class="isOnchuzhou" value="0">

					</div>
				</div>


			</div>
			<div class="title">
				<span>5.是否为合肥(瑶海区)、蚌埠等安徽省内来滁人员？</span>
				<div class="fix">
					<div class="mui-input-row mui-radio mui-left">
						<label>是</label>
						<input name="isField" type="radio" value="1">

					</div>
					<div class="mui-input-row mui-radio mui-left">
						<label>否</label>
						<input name="isField" type="radio" value="0">

					</div>
				</div>


			</div>
			<div class="title">
				<span>6.是否为外市返滁人员？</span>
				<div class="fix">
					<div class="mui-input-row mui-radio mui-left">
						<label>是</label>
						<input name="isGoback" type="radio" value="1">

					</div>
					<div class="mui-input-row mui-radio mui-left">
						<label>否</label>
						<input name="isGoback" type="radio" value="0">

					</div>
				</div>


			</div>
			<div class="title">
				<span>7.您所居住楼道是否有确诊病例或者高度疑似、正在隔离的病例？</span>
				<div class="fix">
					<div class="mui-input-row mui-radio mui-left">
						<label>是</label>
						<input name="isLive" type="radio" value="1">

					</div>
					<div class="mui-input-row mui-radio mui-left">
						<label>否</label>
						<input name="isLive" type="radio" value="0">

					</div>
				</div>


			</div>

			<div class="title">
				<span>8.过去14天，是否有湖北及周边地区、或其他有病例报告社区的旅行史或居住史？</span>
				<div class="fix">
					<div class="mui-input-row mui-radio mui-left">
						<label>是</label>
						<input name="isTravel" type="radio" value="1">

					</div>
					<div class="mui-input-row mui-radio mui-left">
						<label>否</label>
						<input name="isTravel" type="radio" value="0">

					</div>
				</div>


			</div>
			<div class="title">
				<span>9.过去14天，是否与新型冠状病毒感染者有接触？</span>
				<div class="fix">
					<div class="mui-input-row mui-radio mui-left">
						<label>是</label>
						<input name="isContact" type="radio" value="1">

					</div>
					<div class="mui-input-row mui-radio mui-left">
						<label>否</label>
						<input name="isContact" type="radio" value="0">

					</div>
				</div>


			</div>
			<div class="title">
				<span>10.过去14天，是否前往过人群密集的公共场所，或者参加过聚会？</span>
				<div class="fix">
					<div class="mui-input-row mui-radio mui-left">
						<label>是</label>
						<input name="isParty" type="radio" value="1">

					</div>
					<div class="mui-input-row mui-radio mui-left">
						<label>否</label>
						<input name="isParty" type="radio" value="0">

					</div>
				</div>


			</div>
			<div class="title">
				<span style="color: red;">本人郑重承诺</span>
				<div class="fix">
					<div class="mui-input-row mui-radio mui-left">
						<label style="color: red;">为疫情防控，本人同意以上信息依法提交所在辖区疫情防控部门统筹管理</label>
						<input name="radio21" type="radio" value="1">

					</div>

				</div>


			</div>
			<div class="title">
				<div class="fix">
					<div class="mui-input-row mui-radio mui-left">
						<label style="color: red;">上述信息是我本人填写，本人对信息内容的真实性和完整性负责。
							如果信息有误或缺失，本人愿承担相应的法律责任。同时，本人保证遵守防疫管控的各项规定，配合并听从各项措施和要求</label>
						<input name="radio20" type="radio" value="1">

					</div>

				</div>


			</div>
			<!-- 底部提交按钮 -->
			<div class="btn">
				<button type="button" class="mui-btn mui-btn-blue b">提交</button>
			</div>
		</div>
	</body>

</html>
